package com.wust.smartcity.autotask.server.core.api.feign.client.impl;

import com.wust.smartcity.autotask.server.core.api.feign.client.DemoService;
import com.wust.smartcity.common.dto.WebResponseDto;
import com.wust.smartcity.common.entity.demo.Demo;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.stereotype.Service;

@Service
public class DemoServiceFallbackImpl implements DemoService {
    static Logger logger = LogManager.getLogger(DemoServiceFallbackImpl.class);

    @Override
    public WebResponseDto select(String ctx, Demo search) {
        logger.error("调用demo-server服务异常，熔断器发生作用{}",ctx);
        WebResponseDto responseDto = new WebResponseDto();
        responseDto.setFlag(WebResponseDto.INFO_ERROR);
        responseDto.setMessage("调用demo-server服务异常");
        return responseDto;
    }

    @Override
    public WebResponseDto deleteByPrimaryKey(String ctx, Long id) {
        logger.error("调用demo-server服务异常，熔断器发生作用{}",ctx);
        WebResponseDto responseDto = new WebResponseDto();
        responseDto.setFlag(WebResponseDto.INFO_ERROR);
        responseDto.setMessage("调用demo-server服务异常");
        return responseDto;
    }
}
